﻿<Window x:Class="WpfBasicDataTemplate.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:app="clr-namespace:WpfBasicDataTemplate"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <app:Data x:Key="myData" Name="Ravi" PhoneNumber="888888" City="Ongole"/>
        <app:Data x:Key="myOtherData" Name="Sai" PhoneNumber="99999" City="Ongole"/>
        <DataTemplate DataType="{x:Type app:Data}">
            <Grid>
                <Grid.Resources>
                    <Style TargetType="TextBlock">
                        <Setter Property="HorizontalAlignment" Value="Center"/>
                        <Setter Property="VerticalAlignment" Value="Top"/>
                    </Style>
                </Grid.Resources>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <TextBlock Text="{Binding Path=Name}" Grid.Column="0"></TextBlock>
                <TextBlock Text="{Binding Path=City}" Grid.Column="1"></TextBlock>
                <TextBlock Text="{Binding Path=PhoneNumber}" Grid.Column="2"></TextBlock>
            </Grid>
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="FontSize" Value="16"/>
                    <Setter Property="FontWeight" Value="Bold"/>
                    <Setter Property="HorizontalAlignment" Value="Center"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                </Style>
            </Grid.Resources>
            <TextBlock Text="Name" Grid.Column="0" ></TextBlock>
            <TextBlock Text="City" Grid.Column="1" ></TextBlock>
            <TextBlock Text="PhoneNuber" Grid.Column="2"></TextBlock>
            <!--<ItemsControl ItemsSource="{Binding}" Grid.Row="1" ItemTemplate="{StaticResource RowTemplate}"></ItemsControl>-->
        </Grid>
    <Grid Grid.Row="1">
            <ContentControl Content="{StaticResource myData}" Grid.Row="1"></ContentControl>
    </Grid>
    <Grid Grid.Row="2">
            <ContentControl Content="{StaticResource myOtherData}" ></ContentControl>
    </Grid>
  </Grid>
</Window>
